<template>
  <div class="app-container">
    <CustomContent>
      <template v-slot:body>
        <el-row>
          <el-col :span="24">
            <MmvTitle title="新订单通知">
              <div style=" margin-left: 20px; margin-top: 3px; color: #a59d9dd6;">(注：开通后，若客户在小程序下单，相关人员即可收到短信通知)</div>
            </MmvTitle>
          </el-col>
          <el-col :span="23" :offset="1">
            <div>通知内容：</div>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <el-input type="textarea" v-model="content" readonly></el-input>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <div><span style="color: red;">*</span>门店配置:</div>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <div class="custom_card">
              <el-table
                v-loading="loading"
                :data="newOrderList"
                border
              >
                <el-table-column
                  label="门店名称"
                  align="center"
                  prop="storeName"
                  min-width="150"
                  :show-overflow-tooltip="true"
                />

                <el-table-column
                  label="新订单通知人员"
                  align="center"
                  prop="pushStaffName"
                  min-width="100"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    {{scope.row.pushStaffName}}
                  </template>
                </el-table-column>
                <el-table-column
                  label="操作"
                  align="center"
                  prop="memberStatus"
                  min-width="100"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    <el-button type="text" size="mini" @click="selectUser(scope.row)">设置人员</el-button>
                  </template>
                </el-table-column>
                <el-table-column
                  label="禁用/启用"
                  align="center"
                  prop="memberStatus"
                  min-width="100"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    <el-switch
                      v-model="scope.row.status"
                      active-color="#13ce66"
                      inactive-color="#ff4949"
                      :active-value="2"
                      :inactive-value="1">
                    </el-switch>
                  </template>
                </el-table-column>
              </el-table>

              <pagination
                v-show="total > 0"
                :total="total"
                :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize"
                @pagination="getNewOrderList"
              />
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <MmvTitle title="业务员通知">
              <div style=" margin-left: 20px; margin-top: 3px; color: #a59d9dd6;">(注：开通后，将订单分配给业务员，业务员即可收到短信通知)</div>
            </MmvTitle>
          </el-col>
          <el-col :span="23" :offset="1">
            <div>通知内容：</div>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <el-input type="textarea" v-model="content1" readonly></el-input>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <div><span style="color: red;">*</span>门店配置:</div>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <div class="custom_card">
              <el-table
                v-loading="salespersonNoticeLoading"
                :data="salespersonNoticeList"
                border
              >
                <el-table-column
                  label="门店名称"
                  align="center"
                  prop="storeName"
                  min-width="150"
                  :show-overflow-tooltip="true"
                />
                <el-table-column
                  label="禁用/启用"
                  align="center"
                  prop="memberStatus"
                  min-width="100"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    <el-switch
                      v-model="scope.row.status"
                      active-color="#13ce66"
                      inactive-color="#ff4949"
                      :active-value="2"
                      :inactive-value="1">
                    </el-switch>
                  </template>
                </el-table-column>
              </el-table>

              <pagination
                v-show="salespersonNoticeTotal > 0"
                :total="salespersonNoticeTotal"
                :page.sync="queryParams1.pageNum"
                :limit.sync="queryParams1.pageSize"
                @pagination="getSalespersonNoticeList"
              />
            </div>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <MmvTitle title="用户取车通知">
              <div style=" margin-left: 20px; margin-top: 3px; color: #a59d9dd6;">(注：开通后，距离客户取车2小时，推送短信至客户手机)</div>
            </MmvTitle>
          </el-col>
          <el-col :span="23" :offset="1">
            <div>到店取车通知内容：</div>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <el-input type="textarea" v-model="content2" readonly></el-input>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <div>上门送车通知内容：</div>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <el-input type="textarea" v-model="content3" readonly></el-input>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <div><span style="color: red;">*</span>门店配置:</div>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <div class="custom_card">
              <el-table
                v-loading="pickupNotificationLoading"
                :data="userPickupNotificationList"
                border
              >
                <el-table-column
                  label="门店名称"
                  align="center"
                  prop="storeName"
                  min-width="150"
                  :show-overflow-tooltip="true"
                />
                <el-table-column
                  label="禁用/启用"
                  align="center"
                  prop="memberStatus"
                  min-width="100"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    <el-switch
                      v-model.number="scope.row.status"
                      active-color="#13ce66"
                      inactive-color="#ff4949"
                      :active-value="2"
                      :inactive-value="1">
                    </el-switch>
                  </template>
                </el-table-column>
              </el-table>

              <pagination
                v-show="pickupNotificationTotal > 0"
                :total="pickupNotificationTotal"
                :page.sync="queryParams2.pageNum"
                :limit.sync="queryParams2.pageSize"
                @pagination="getUserPickupNotificationList"
              />
            </div>
          </el-col>
        </el-row>


        <el-row v-if="checkPermi(['car:alarm:list'])">
          <el-col :span="24">
            <MmvTitle title="告警通知">
              <div style=" margin-left: 20px; margin-top: 3px; color: #a59d9dd6;">(注：开通后，若车辆触发GPS告警，相关人员即可收到短信通知)</div>
            </MmvTitle>
          </el-col>
          <el-col :span="23" :offset="1">
            <div>通知内容：</div>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <el-input type="textarea" v-model="content5" readonly></el-input>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <div><span style="color: red;">*</span>门店配置:</div>
          </el-col>
          <el-col :span="23" :offset="1" style="margin-top: 20px;">
            <div class="custom_card">
              <el-table
                v-loading="gpsAlarmNotificationLoading"
                :data="gpsAlarmNotificationList"
                border
              >
                <el-table-column
                  label="门店名称"
                  align="center"
                  prop="storeName"
                  min-width="150"
                  :show-overflow-tooltip="true"
                />
                <el-table-column
                  label="通知人员"
                  align="center"
                  prop="pushStaffName"
                  min-width="100"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    {{scope.row.pushStaffName}}
                  </template>
                </el-table-column>
                <el-table-column
                  label="告警类型"
                  align="center"
                  prop="alarmName"
                  min-width="100"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    {{scope.row.alarmName}}
                  </template>
                </el-table-column>
                <el-table-column
                  label="操作"
                  align="center"
                  prop="memberStatus"
                  min-width="100"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    <el-button type="text" size="mini" @click="selectUser2(scope.row)">设置人员</el-button>
                  </template>
                </el-table-column>
                <el-table-column
                  label="禁用/启用"
                  align="center"
                  prop="memberStatus"
                  min-width="100"
                  :show-overflow-tooltip="true"
                >
                  <template slot-scope="scope">
                    <el-switch
                      v-model="scope.row.status"
                      active-color="#13ce66"
                      inactive-color="#ff4949"
                      :active-value="2"
                      :inactive-value="1">
                    </el-switch>
                  </template>
                </el-table-column>
              </el-table>

              <pagination
                v-show="total > 0"
                :total="total"
                :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize"
                @pagination="getNewOrderList"
              />
            </div>
          </el-col>
        </el-row>
      </template>
      <template v-slot:footer>
        <div class="footer">
          <el-button type="" @click="refresh" :loading="loading2"
          >刷新</el-button
          >
          <el-button type="primary" @click="submitForm" :loading="loading">
            保存</el-button
          >
        </div>
      </template>
    </CustomContent>

    <el-drawer
      title="人员配置"
      :visible.sync="drawerFlagUser"
      :direction="directionUser" size="50%"
      :before-close="handleUserClose" :modal="false">
      <el-row>
        <el-col :span="22" :offset="1">
          <div>已选人员：</div>
        </el-col>
        <el-col :span="22" :offset="1" style="margin-top: 20px;">
          <el-input type="textarea" v-model="content4" readonly></el-input>
        </el-col>
      </el-row>
      <el-form :model="queryParamsUser" ref="queryUserForm" :inline="true"  label-width="68px" style="margin-top: 20px;">
        <el-form-item label="姓名" prop="name">
          <el-input
            v-model="queryParamsUser.userName"
            placeholder="请输入名称"
            clearable
            size="small"
          />
        </el-form-item>
        <el-form-item label="手机号" prop="phonenumber">
          <el-input
            v-model="queryParamsUser.phonenumber"
            placeholder="请输入手机号"
            clearable
            size="small"
          />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryUser">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQueryUser">重置</el-button>
        </el-form-item>
      </el-form>
      <div class="custom_card">
        <el-table v-loading="loadingDrawer" tooltip-effect="dark" row-key="userId" ref="multipleTable"
                  :data="UserDrawerList" border  @selection-change="handleSelectionChange">
          <el-table-column
            type="selection"
            :reserve-selection="true"
            width="55">
          </el-table-column>
          <el-table-column label="编号" align="center" prop="userId" />
          <el-table-column label="名称" align="center" prop="userName" />
          <el-table-column label="手机号" align="center" prop="phonenumber" />
          <el-table-column
            label="角色"
            align="center"
            key="roleName"
            prop="roleName"
            min-width="160"
            show-overflow-tooltip
          />
        </el-table>
      </div>
      <pagination
        v-show="totalUser>0"
        :total="totalUser"
        :page.sync="queryParamsUser.pageNum"
        :limit.sync="queryParamsUser.pageSize"
        @pagination="getUserList"
      />
      <el-row style="margin-top: 20px;">
        <el-col :span="8" :offset="8">
          <el-button @click="handleUserClose">取 消</el-button>
          <el-button type="primary" @click="confirm">确 认</el-button>
        </el-col>
      </el-row>
    </el-drawer>
    <el-drawer
      title="人员配置"
      :visible.sync="drawerFlagUser2"
      :direction="directionUser2" size="50%"
      :before-close="handleUserClose" :modal="false">
      <el-row>
        <el-col :span="22" :offset="1">
          <div>告警类型：</div>
        </el-col>
        <el-col :span="22" :offset="1" style="margin-top: 20px;">
          <el-select
            v-model="alarmType"
            multiple
            placeholder="告警类型"
            clearable
            :style="{ width: '100%' }"
          >
            <el-option v-for="dict in dict.type.gps_alarm_type" :key="dict.value" :label="dict.label" :value="dict.value" />
          </el-select>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="22" :offset="1">
          <div>已选人员：</div>
        </el-col>
        <el-col :span="22" :offset="1" style="margin-top: 20px;">
          <el-input type="textarea" v-model="content6" readonly></el-input>
        </el-col>
      </el-row>
      <el-form :model="queryParamsUser2" ref="queryUserForm2" :inline="true"  label-width="68px" style="margin-top: 20px;">
        <el-form-item label="姓名" prop="name">
          <el-input
            v-model="queryParamsUser2.userName"
            placeholder="请输入名称"
            clearable
            size="small"
          />
        </el-form-item>
        <el-form-item label="手机号" prop="phonenumber">
          <el-input
            v-model="queryParamsUser2.phonenumber"
            placeholder="请输入手机号"
            clearable
            size="small"
          />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQueryUser2">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQueryUser2">重置</el-button>
        </el-form-item>
      </el-form>
      <div class="custom_card">
        <el-table v-loading="loadingDrawer2" tooltip-effect="dark" row-key="userId" ref="multipleTable"
                  :data="UserDrawerList2" border  @selection-change="handleSelectionChange2">
          <el-table-column
            type="selection"
            :reserve-selection="true"
            width="55">
          </el-table-column>
          <el-table-column label="编号" align="center" prop="userId" />
          <el-table-column label="名称" align="center" prop="userName" />
          <el-table-column label="手机号" align="center" prop="phonenumber" />
          <el-table-column
            label="角色"
            align="center"
            key="roleName"
            prop="roleName"
            min-width="160"
            show-overflow-tooltip
          />
        </el-table>
      </div>
      <pagination
        v-show="totalUser2>0"
        :total="totalUser2"
        :page.sync="queryParamsUser2.pageNum"
        :limit.sync="queryParamsUser2.pageSize"
        @pagination="getUserList2"
      />
      <el-row style="margin-top: 20px;">
        <el-col :span="8" :offset="8">
          <el-button @click="handleUserClose">取 消</el-button>
          <el-button type="primary" @click="confirm2">确 认</el-button>
        </el-col>
      </el-row>
    </el-drawer>
  </div>
</template>

<script>
import {
  newOrderList,
  salespersonNoticeList,
  userPickupNotificationList,
  gpsAlarmNotification,
  storeUserList,
  addMmstemplate
} from '@/api/message/mmstemplate'
import {checkPermi} from '@/utils/permission'

import MmvTitle from '@/components/MmvUI/MmvTitle.vue'
import CustomContent from '@/components/custom/content.vue'

export default {
  components: {
    MmvTitle,
    CustomContent,
  },
  name: 'Mmstemplate',
  dicts: ['sys_available', 'sms_template', 'push_node','gps_alarm_type'],
  data() {
    return {
      loading2:false,
      // 遮罩层
      loading: true,
      salespersonNoticeLoading: true,
      pickupNotificationLoading: true,
      gpsAlarmNotificationLoading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      optionaParams: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      salespersonNoticeTotal: 0,
      pickupNotificationTotal: 0,
      gpsAlarmNotificationTotal: 0,
      // 消息模板表格数据--新订单通知
      newOrderList: [],
      // 消息模板表格数据--业务员通知
      salespersonNoticeList: [],
      // 消息模板表格数据--用户取车通知
      userPickupNotificationList: [],

      gpsAlarmNotificationList: [],
      // 弹出层标题
      title: '',
      // 是否显示弹出层
      open: false,
      storeList:[],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        title: null,
        name: null,
        status: null,
      },
      queryParams1: {
        pageNum: 1,
        pageSize: 10,
        title: null,
        name: null,
        status: null,
      },
      queryParams2: {
        pageNum: 1,
        pageSize: 10,
        title: null,
        name: null,
        status: null,
      },
      queryParams3: {
        pageNum: 1,
        pageSize: 10,
        title: null,
        name: null,
        status: null,
      },
      drawerFlagUser: false,
      drawerFlagUser2: false,
      loadingDrawer:false,
      loadingDrawer2:false,
      directionUser: 'rtl',
      directionUser2: 'rtl',
      alarmType: [],
      alarmName: [],
      UserDrawerList:[],
      UserDrawerList2:[],
      totalUser:0,
      totalUser2:0,
      queryParamsUser:{
        pageNum: 1,
        pageSize: 10,
        deptIdTemplate:null,
        userName:"",
        phonenumber:""
      },
      queryParamsUser2:{
        pageNum: 1,
        pageSize: 10,
        deptIdTemplate:null,
        userName:"",
        phonenumber:""
      },
      mmstemplate:{},
      formData: {
        name: '',
        title: '',
        param: [],
        content: '',
      },
      rules: {
      },
      content:"您有一笔新订单！客户:{名称}或{手机号码} 已预定：{品牌/车系}，请及时处理。",
      content1:"已为您分配新订单：{订单号}，请及时处理！",
      content2:"尊敬的用户：您有一笔租车订单({订单号})已临近取车时间，请及时前往{取车门店}取车。友情提示：请携带本人身份证、驾驶证前往。",
      content3:"尊敬的用户：您有一笔租车订单({订单号})已临近用车时间，业务员将为您送车上门。",
      content5:"车辆{车牌号}绑定的设备{设备编码}触发{告警类型}，定位地点为：{定位地点}。关联用车中订单{订单编号}，客户为{客户姓名 客户联系电话}。",
      content4:[],
      content6:[],
      rowSelectFlag: false
    }
  },
  created() {
    this.getNewOrderList()
    this.getSalespersonNoticeList()
    this.getUserPickupNotificationList()
    this.getGpsAlarmNotificationList()
  },
  methods: {
    checkPermi,
    //刷新
    refresh(){
      this.loading2=true;
      this.getNewOrderList()
      this.getSalespersonNoticeList()
      this.getUserPickupNotificationList()
      this.getGpsAlarmNotificationList()
      this.loading2=false;
    },
    /** 查询消息模板列表--订单 */
    getNewOrderList() {
      this.loading = true
      newOrderList(this.queryParams).then((response) => {
        this.newOrderList = response.rows
        this.total = response.total
        this.loading = false
      })
    },
    /** 查询消息模板列表--业务员通知 */
    getSalespersonNoticeList() {
      this.salespersonNoticeLoading = true
      salespersonNoticeList(this.queryParams1).then((response) => {
        this.salespersonNoticeList = response.rows
        this.salespersonNoticeTotal = response.total
        this.salespersonNoticeLoading = false
      })
    },
    /** 查询消息模板列表--用户取车通知 */
    getUserPickupNotificationList() {
      this.pickupNotificationLoading = true
      userPickupNotificationList(this.queryParams2).then((response) => {
        this.userPickupNotificationList = response.rows
        this.pickupNotificationTotal = response.total
        this.pickupNotificationLoading = false
      })
    },
    /** 查询消息模板列表--gps告警 */
    getGpsAlarmNotificationList() {
      this.gpsAlarmNotificationLoading = true
      gpsAlarmNotification(this.queryParams3).then((response) => {
        this.gpsAlarmNotificationList = response.rows
        this.gpsAlarmNotificationTotal = response.total
        this.gpsAlarmNotificationLoading = false
      })
    },
    handleUserClose() {
      this.drawerFlagUser=false;
      this.drawerFlagUser2=false;
    },
    selectUser(row){
      //this.$refs.multipleTable.clearSelection();
      this.drawerFlagUser=true;
      this.queryParamsUser.pageNum=1;
      this.queryParamsUser.deptIdTemplate=row.deptId;
      this.mmstemplate=row;
      this.getUserList(row);
    },
    selectUser2(row){
      //this.$refs.multipleTable.clearSelection();
      this.drawerFlagUser2=true;
      this.queryParamsUser2.pageNum=1;
      this.queryParamsUser2.deptIdTemplate=row.deptId;
      this.mmstemplate=row;
      this.getUserList2(row);
    },
    handleQueryUser(){
      this.queryParamsUser.pageNum = 1;
      this.getUserList();
    },
    handleQueryUser2(){
      this.queryParamsUser2.pageNum = 1;
      this.getUserList2();
    },
    /** 查询用户列表 */
    getUserList() {
      if(this.mmstemplate){
        this.ids=this.mmstemplate.pushStaff?this.mmstemplate.pushStaff.split(","):[];
        this.content4=this.mmstemplate.pushStaffName?this.mmstemplate.pushStaffName.split(","):[];
      }
      this.loadingDrawer = true;
      storeUserList(this.queryParamsUser).then(response => {
        this.UserDrawerList = response.rows;
        setTimeout(() => {
          this.rowSelectFlag = true
          this.UserDrawerList.forEach(row => {
            this.ids.forEach(id=>{
              if(parseInt(id)==parseInt(row.userId)){
                this.$refs.multipleTable.toggleRowSelection(row,true);
                /* this.$nextTick(()=>{
                   this.$refs.multipleTable.toggleRowSelection(row,true);
                 })*/
              }
            })
          });
          this.rowSelectFlag = false
        }, 0)
        this.totalUser = response.total;
        this.loadingDrawer = false;
      });
    },
    getUserList2() {
      if(this.mmstemplate){
        this.ids=this.mmstemplate.pushStaff?this.mmstemplate.pushStaff.split(","):[];
        this.content6=this.mmstemplate.pushStaffName?this.mmstemplate.pushStaffName.split(","):[];
        this.alarmType=this.mmstemplate.alarmType?this.mmstemplate.alarmType.split(","):[];
        this.alarmName=this.mmstemplate.alarmName?this.mmstemplate.alarmName.split(","):[];
      }
      this.loadingDrawer2 = true;
      storeUserList(this.queryParamsUser2).then(response => {
        this.UserDrawerList2 = response.rows;
        setTimeout(() => {
          this.rowSelectFlag = true
          this.UserDrawerList2.forEach(row => {
            this.ids.forEach(id=>{
              if(parseInt(id)==parseInt(row.userId)){
                this.$refs.multipleTable.toggleRowSelection(row,true);
              }
            })
          });
          this.rowSelectFlag = false
        }, 0)
        this.totalUser2 = response.total;
        this.loadingDrawer2 = false;
      });
    },
    /** 重置按钮操作 */
    resetQueryUser() {
      this.queryParamsUser={
        pageNum: 1,
        pageSize: 10,
        deptIdTemplate:this.queryParamsUser.deptIdTemplate,
        userName:"",
        phonenumber:""
      };
      this.handleQueryUser();
    },
    /** 重置按钮操作 */
    resetQueryUser2() {
      this.queryParamsUser2={
        pageNum: 1,
        pageSize: 10,
        deptIdTemplate:this.queryParamsUser2.deptIdTemplate,
        userName:"",
        phonenumber:""
      };
      this.handleQueryUser2();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      if (this.rowSelectFlag) return
      selection=selection.filter(x=>x.deptId==this.queryParamsUser.deptIdTemplate)
      this.ids=selection.map((item) => item.userId)
      this.content4=selection.map((item) => item.userName)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    // 多选框选中数据
    handleSelectionChange2(selection) {
      if (this.rowSelectFlag) return
      selection=selection.filter(x=>x.deptId==this.queryParamsUser2.deptIdTemplate)
      this.ids=selection.map((item) => item.userId)
      this.content6=selection.map((item) => item.userName)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    confirm(){
      let deptId = this.queryParamsUser.deptIdTemplate;
      this.newOrderList.forEach(item=>{
        if(item.deptId===deptId){
          this.$set(item, 'pushStaff', this.ids.join(","))
          this.$set(item, 'pushStaffName', this.content4.join(","))
        }
      })
      this.handleUserClose();
    },
    confirm2(){
      this.alarmName=[];
      this.dict.type.gps_alarm_type.forEach(item=>{
        if(this.alarmType.includes(item.value)){
          this.alarmName.push(item.label)
        }
      })
      let deptId = this.queryParamsUser2.deptIdTemplate;
      this.gpsAlarmNotificationList.forEach(item=>{
        if(item.deptId===deptId){
          this.$set(item, 'pushStaff', this.ids.join(","))
          this.$set(item, 'pushStaffName', this.content6.join(","))
          this.$set(item, 'alarmType', this.alarmType.join(","))
          this.$set(item, 'alarmName', this.alarmName.join(","))
        }
      })
      this.handleUserClose();
    },
    /** 提交按钮 */
    submitForm() {
      let data={
        newOrderList:this.newOrderList,
        salespersonNoticeList:this.salespersonNoticeList,
        userPickupNotificationList:this.userPickupNotificationList,
        gpsAlarmNotificationList:this.gpsAlarmNotificationList,
      }
      addMmstemplate(data).then((response) => {
        this.$modal.msgSuccess('保存成功')
        this.open = false
        this.refresh()
      })
    },

  },
}
</script>
<style scoped="scoped">
/deep/ .this_textarea textarea {
  resize: none;
}

.param_btn {
  width: 100px;
  margin: 5px;
}
</style>
